#!/bin/bash

echo "Looking for orkut-os-client-*.jar..."

# Look for the orkut-os-client bin package in .. or ../dist
CANDIDATES=`echo orkut-os-client-*.jar ../orkut-os-client-*.jar ../dist/orkut-os-client-*.jar`

JAR=""

for i in $CANDIDATES; do
   if [ -f "$i" ]; then
      echo "Found: $i"
      JAR="$i"
      break
   fi
done

if [ -z "$JAR" ]; then
   echo "Could not find orkut-os-client-*.jar"
   echo "Please place the jar file in this directory and try again."
   exit 1
fi

echo "Using jar file: $JAR"

export CLASSPATH=".:$JAR"
javac Sample.java && java Sample

